package com.hsnn.medstgmini.pro.base.model;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.hsnn.medstgmini.util.DateUtil;


/**
 * BaseDelrelationLog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="base_delrelation_log")

public class BaseDelrelationLog  implements java.io.Serializable {


    // Fields    

     private String logId;
     private String delRelId;
     private String goodsCode;
     private String prodCompId;
     private String areaCode;
     private String delCompId;
     private String hospId;
     private Short status;
     private Timestamp updDatetime;
     private String updUser;
     
     private Date startTime;
     private Date endTime;
     private String updDatetimeStr;


    // Constructors

    /** default constructor */
    public BaseDelrelationLog() {
    }

	/** minimal constructor */
    public BaseDelrelationLog(String logId) {
        this.logId = logId;
    }
    
    /** full constructor */
    public BaseDelrelationLog(String logId, String delRelId, String drugId, String prodCompId, String areaCode, String delCompId, String hospId, Short status, Timestamp updDatetime, String updUser) {
        this.logId = logId;
        this.delRelId = delRelId;
        this.goodsCode = drugId;
        this.prodCompId = prodCompId;
        this.areaCode = areaCode;
        this.delCompId = delCompId;
        this.hospId = hospId;
        this.status = status;
        this.updDatetime = updDatetime;
        this.updUser = updUser;
    }

   
    // Property accessors
    @Id 
	@GenericGenerator(name = "BaseDelrelationLoggenerator", strategy = "uuid")
	@GeneratedValue(generator = "BaseDelrelationLoggenerator")
    @Column(name="log_id", unique=true, nullable=false, length=36)

    public String getLogId() {
        return this.logId;
    }
    
    public void setLogId(String logId) {
        this.logId = logId;
    }
    
    @Column(name="del_rel_id", length=36)

    public String getDelRelId() {
        return this.delRelId;
    }
    
    public void setDelRelId(String delRelId) {
        this.delRelId = delRelId;
    }
    
    @Column(name="goods_code", length=36)

    public String getGoodsCode() {
        return this.goodsCode;
    }
    
    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }
    
    @Column(name="prod_comp_id", length=36)

    public String getProdCompId() {
        return this.prodCompId;
    }
    
    public void setProdCompId(String prodCompId) {
        this.prodCompId = prodCompId;
    }
    
    @Column(name="area_code", length=10)

    public String getAreaCode() {
        return this.areaCode;
    }
    
    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }
    
    @Column(name="del_comp_id", length=36)

    public String getDelCompId() {
        return this.delCompId;
    }
    
    public void setDelCompId(String delCompId) {
        this.delCompId = delCompId;
    }
    
    @Column(name="hosp_id", length=36)

    public String getHospId() {
        return this.hospId;
    }
    
    public void setHospId(String hospId) {
        this.hospId = hospId;
    }
    
    @Column(name="status")

    public Short getStatus() {
        return this.status;
    }
    
    public void setStatus(Short status) {
        this.status = status;
    }
    
    @Column(name="upd_datetime", length=19)

    public Timestamp getUpdDatetime() {
        return this.updDatetime;
    }
    
    public void setUpdDatetime(Timestamp updDatetime) {
        this.updDatetime = updDatetime;
    }
    
    @Column(name="upd_user", length=36)

    public String getUpdUser() {
        return this.updUser;
    }
    
    public void setUpdUser(String updUser) {
        this.updUser = updUser;
    }
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Transient
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Transient
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	@Transient
	public String getUpdDatetimeStr() {
		if (updDatetime != null) {
			updDatetimeStr = DateUtil.date(updDatetime);
		}
		return updDatetimeStr;
	}

	public void setUpdDatetimeStr(String updDatetimeStr) {
		this.updDatetimeStr = updDatetimeStr;
	}
    
	

    








}